package com.wnxy.d_topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class C2 {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "Q2"),
            exchange = @Exchange(name = "exchange-topic",type = ExchangeTypes.TOPIC),
            key = {"*.*.rabbit","lazy.#"}
    ))
    public void handlerMsg(String msg) {
        System.out.println("C1是Lazy Rabbit："+msg);
    }
}
